﻿namespace CSharpPro._0929;

public class demo1
{
    public static void FindPrimes()
    {
        Console.WriteLine("100以内的所有质数：");
        
        for (int num = 2; num <= 100; num++)
        {
            bool isPrime = true;
            
            for (int i = 2; i <= Math.Sqrt(num); i++)
            {
                if (num % i == 0)
                {
                    isPrime = false;
                    break;
                }
            }
            
            if (isPrime)
            {
                Console.Write(num + " ");
            }
        }
        
        Console.WriteLine();
    }
}